package com.yidu.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Select;

import com.yidu.model.SnMaQuality;
import com.yidu.model.SnProDetail;

public interface SnMaQualityMapper {
    int deleteByPrimaryKey(String mqId);

    int insert(SnMaQuality record);

    int insertSelective(SnMaQuality record);

    SnMaQuality selectByPrimaryKey(String mqId);

    int updateByPrimaryKeySelective(SnMaQuality record);

    int updateByPrimaryKey(SnMaQuality record);
    /**
	 * 查询所有
	 * @param maps 分页 条件
	 * @return 财产采购质检model集合
	 */
	List<SnProDetail> findAll(Map<String, Object> maps);
	/**
	 * 查询行数
	 * @param maps 条件
	 * @return 行数
	 */
	int findCount(Map<String, Object> maps);
	/**
	 * 根据质检id查询通过数量和材料id
	 * @param mqId 质检id
	 * @return 
	 */
	@Select("SELECT * FROM sn_ma_detail md,sn_materials ma WHERE md.oper=ma.ma_name AND  md.mq_id=#{mqId}")
	List<Map<String, Object>> selectComId(String mqId);
}